package com.rpj.stauy.config;

import dev.langchain4j.community.model.dashscope.WanxImageModel;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.chat.StreamingChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.model.openai.OpenAiStreamingChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ImageAiConfig {

    //图生文
    @Bean("chat")
    public ChatModel chatModel(){
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("aliQwen_api"))
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .modelName("qwen-vl-max")
                .build();
    }

    //文生图
    @Bean("chatimage")
    public WanxImageModel imageChatModel(){
        return WanxImageModel.builder()
                .apiKey(System.getenv("aliQwen_api"))
//                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .modelName("wanx2.1-t2i-turbo")
                .build();
    }

}
